import ProxyInterface from '../proxy-interface';
import {BoxUserModel, ResumesModel, UserModel} from '@pkpm/pkpm-types';

class UserModelProxy implements ProxyInterface<UserModel> {
    public userModel = new UserModel();

    constructor(responseData) {
        const data = responseData.data || responseData;
        Object.assign<UserModel, UserModel>(this.userModel, data);
    }

    getModel(): UserModel {
        return this.userModel;
    }
}

class BoxUserModelProxy implements ProxyInterface<BoxUserModel> {
    public userModel = new BoxUserModel();

    constructor(responseData) {
        const data = responseData.data || responseData;
        Object.assign<BoxUserModel, BoxUserModel>(this.userModel, data);
    }

    getModel(): BoxUserModel {
        return this.userModel;
    }
}

class UserResumesModelProxy implements ProxyInterface<ResumesModel> {
    public resumesModel = new ResumesModel();

    constructor(responseData) {
        const data = responseData.data || responseData;
        Object.assign<ResumesModel, any>(this.resumesModel, data);
    }

    getModel(): ResumesModel {
        return this.resumesModel;
    }
}
export {UserResumesModelProxy, UserModelProxy, BoxUserModelProxy};
